package action.conctrol;

import model.TNjob;
import model.TProduction;
import model.VProduction;
import persistent.dao.NjobDAO;
import persistent.dao.ProductionDAO;
import persistent.factory.DAOFactory;

public class ScanProductionAction extends BaseAction {

	private String name;

	


	public String getName() {
		return name;
	}




	public void setName(String name) {
		this.name = name;
	}




	/**
	 * @return
	 */
	public String execute() {
		// TODO Auto-generated method stub
		ProductionDAO dao = DAOFactory.getProductionDAO();
		VProduction  production = dao.getProductionByName(name);
		if (production==null || production.getPrdname().equals("")) {
			return null;
		}
		else {
			request.setAttribute("production", production);
			return SUCCESS;
		}
		
	}
}